<script setup lang="ts">
import {addUserLove, findUserById} from "@/Network/userApi";
import {onMounted, Ref, ref} from "vue";
import {findSongsByStyle, randomGenerateSongsByNum} from "@/Network/songApi";
import type {res} from "@/store/dataType";

let userId = ref("11")
let userImg = ref()
findUserById(userId.value).then(res=>{
  // console.log(res.data)
  userImg.value = res.data.userImg
})
onMounted(()=>{
  get310()
})
async function get310 (){
  let style={
    style:"民歌"
  }
  const res1:res<any> = await findSongsByStyle(style)
  console.log(res1.data)


  const res:res<any> = await randomGenerateSongsByNum(3)
  console.log(res.data)



}

randomGenerateSongsByNum(3).then(res=>{
  // console.log(res.data.length)
})

let style={
  style:"民歌"
}
let styleSongs = ref()
findSongsByStyle(style).then(res=>{
  // console.log(res.data.length)
  // console.log(styleSongs.value)
})



addUserLove(11,1).then(res=>{
  // console.log(res.data)
})
</script>

<template>
  <img :src="userImg" alt="用户图片" class="w-12  rounded-full">
</template>

<style scoped>

</style>